<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>上传demo</title>
<link rel="stylesheet" type="text/css" href="uploadify.css">
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="jquery.uploadify.min.js"></script>
<script type="text/javascript">
$(function() {
	var $fileupload = $('#fileupload');
	var $uploadBtn=$('#uploadBtn');
	var $cancelBtn=$('#cancelBtn');
	var $clearBtn=$('#clearBtn');
	
	$fileupload.uploadify({
		'auto' : false,
		'multi' : true,
		'buttonText' : '选择上传文件',
		'fileSizeLimit' : '10MB',//上传文件大小限制
		'fileTypeDesc' : '视频文件',
		'fileTypeExts' : '*.avi; *.mp4; *.mov',//文件类型过滤
		'swf' : 'uploadify.swf',//uploadify.swf的链接
		'uploader' : 'http://www.baidu.com',//上传的链接，这里肯定是失败的！
		//onUploadSuccess为上传完视频之后回调的方法
		'onUploadSuccess' : function(file, data, response) {
			alert("成功上传一个！");
		}
	});
	
	$uploadBtn.click(function(){
		$fileupload.uploadify('upload',"*");
	});
	
	$cancelBtn.click(function(){
		$fileupload.uploadify('cancel');
	});	
	
	$clearBtn.click(function(){
		$fileupload.uploadify('cancel',"*");
	});
});
</script>

</head>
<body>
	<input type="file" id="fileupload" />
	<input type="button" id="uploadBtn" value="点击上传" />
	<input type="button" id="cancelBtn" value="取消当前上传" />
	<input type="button" id="clearBtn" value="取消所有上传" />
</body>